package com.jingjin.humanityservice.controller;

import com.jingjin.common.result.BaseResult;
import com.jingjin.common.result.ResultUtil;
import com.jingjin.humanityservice.service.RankingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * ClassName: RankingController
 * Description:
 *
 * @Author zjm
 */
@RefreshScope // 自动配置更新
@RestController
@RequestMapping("/ranking")
@Slf4j
@Tag(name = "人文接口文档", description = "人文模块接口文档")
public class RankingController {

    @Resource
    private RankingService rankingService;

    @Operation(summary = "获取热搜接口")
    @GetMapping("/getRanking")
    public BaseResult<Map<String, Object>> getRanking(String platform){
        Map<String, Object> result = rankingService.getRanking(platform);
        return ResultUtil.success(result);
    }

}
